package com.jx.mlxg.common;

import lombok.Getter;

@Getter
public enum ExceptionEnum {
    // 通用异常
    UNKNOWN_ERROR(10000, "未知错误"),
    SYSTEM_ERROR(10001, "系统错误"),

    // 业务逻辑异常
    ORDER_NOT_FOUND(20001, "订单不存在"),
    MATERIAL_REQUEST_NOT_EXIST(20002, "发货申请不存在"),
    ADDRESS_NOT_FOUND(20003, "地址信息不存在"),
    PRODUCT_NOT_FOUND(20004, "产品信息不存在"),
    USER_NOT_FOUND(20005, "用户信息不存在"),
    ORDER_CREATION_FAILED(20006, "订单创建失败"),
    ORDER_DETAIL_CREATION_FAILED(20007, "订单详情创建失败"),
    SHIPPING_INFO_CREATION_FAILED(20008, "物流信息创建失败"),
    SHIPPING_INFO_NOT_FOUND(20012, "物流信息不存在"),
    APPROVAL_RECORD_CREATION_FAILED(20009, "审批记录创建失败"),
    DATE_ERROR(20010,"时间格式不正确，请使用格式：yyyy-MM-dd'T'HH:mm:ss"),
    PARAM_ERROR(20011,"参数错误"),
    
    // 支付相关异常
    REFUND_FAILED(20013, "退款失败"),
    REFUND_QUERY_FAILED(20014, "退款查询失败"),
    REFUND_CALLBACK_FAILED(20015, "退款回调处理失败"),
    ORDER_ALREADY_REFUNDED(20016, "订单已退款"),
    REFUND_AMOUNT_EXCEED(20017, "退款金额不能超过订单金额");

    private final int code;
    private final String message;

    ExceptionEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
}
